package com.luguokong.pet_rescue.mapper;

import com.luguokong.pet_rescue.pojo.PetFood;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PetFoodMapper {
    public int insertPetFood(PetFood petFood);
    public int deletePetFoodById(int food_id);
    public int updatePetFoodById(PetFood petFood);
    public PetFood selectPetFoodById(int food_id);
    public List<PetFood> selectPetFoodAll();
    public List<PetFood> selectPetFoodAllByExpDate();
    public List<PetFood> selectPetFoodAllByUnExpDate();
    public List<PetFood> selectPetFoodAllByPetType();
    public List<PetFood> selectPetFoodAllByPriceByDesc();
    public List<PetFood> selectPetFoodAllByPriceByAsc();

    @Select("select * from pet_food limit #{pageNum},#{pageSize}")
    public List<PetFood> selectPetFoodAllByPageNumByPageSize(int pageNum, int pageSize);

    @Select("select count(*) from pet_food")
    public int selectDataCount();

}
